package com.colis.quartz.module.sms;

import com.colis.quartz.common.base.BaseBean;
import com.colis.quartz.common.enumerate.QuartzStatusEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.SuperBuilder;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * <p> 描述：任务调度实体 </p>
 *
 * @author wlp
 * @version 1.0.0
 * @date 2022/1/13 9:30
 */
@Data
@Entity
@SuperBuilder
@NoArgsConstructor
@Table(name = "sms_quartz_task")
@ApiModel(value = "任务调度实体")
public class QuartzTask extends BaseBean {

    /**
     * 任务名称
     */
    @ApiModelProperty(example = "Quartz-Hello")
    @Column(name = "quartz_name")
    private String quartzName;

    /**
     * 任务表达式
     */
    @ApiModelProperty(example = "3 * * * * ? ")
    @Column(name = "quartz_cron")
    private String quartzCron;

    /**
     * 执行的类
     */
    @ApiModelProperty(example = "helloTask")
    @Column(name = "target_bean")
    private String targetBean;

    /**
     * 执行方法
     */
    @ApiModelProperty(example = "executeMethod")
    @Column(name = "target_method")
    private String targetMethod;

    /**
     * 执行方法
     */
    @ApiModelProperty("执行方法")
    @Column(name = "target_content")
    private String targetContent;

    /**
     * 执行参数
     */
    @ApiModelProperty("执行参数")
    @Column(name = "params")
    private String params;

    /**
     * 任务类型- 1普通任务 2.模板任务
     */
    @ApiModelProperty("任务类型- 1普通任务 2.模板任务")
    @Column(name = "quartz_type")
    private Integer quartzType;

    /**
     * 任务状态 0:正常  1：暂停
     */
    @ApiModelProperty("任务状态 0:正常  1：暂停")
    @Column(name = "quartz_status")
    private QuartzStatusEnum quartzStatus;

    /**
     * 备注
     */
    @ApiModelProperty("备注")
    @Column(name = "remark")
    protected String remark = "备注";
}
